﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Metodesa.Master" AutoEventWireup="true" CodeBehind="DetailsVenta.aspx.cs" Inherits="Metodesa.Views.Home.DetailsVenta" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<script language="JavaScript">
var gAutoPrint = true; 
function printSpecial()
{
if (document.getElementById != null)
{
var html = '<HTML>\n<HEAD>\n';

if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}

html += '\n</HE>\n<BODY>\n';

var printReadyElem = document.getElementById("printReady");

if (printReadyElem != null)
{
html += printReadyElem.innerHTML;
}
else
{
alert("Could not find the printReady function");
return;
}

html += '\n</BO>\n</HT>';

var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("The print ready feature is only available if you are using an browser. Please update your browswer.");
}
}

</script>
  
    
<div id="printReady"> 

    <asp:ScriptManager ID="scriptMgr" runat="server" />
        <asp:UpdatePanel ID="updatePnl" runat="server">
            <ContentTemplate>


    <table style="width:100%">
        <tr>
            <td style="font-weight: bold; height: 18px; width: 111px;">
                Codigo</td>
            <td style="height: 18px; width: 111px">
                <asp:Label ID="labelCodigo" runat="server" Text="Label"></asp:Label>
            </td>
            <td style="font-weight: bold; height: 32px; width: 111px;" rowspan="2">
                Cliente</td>
            <td style="font-weight: bold; height: 18px; width: 112px;">
                Nombre</td>
            <td style="height: 18px; width: 112px" >
                <asp:Label ID="labelClienteNombre" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="font-weight: bold; height: 18px; width: 111px;">
                Empleado</td>
            <td style="height: 18px; width: 111px">
                <asp:Label ID="labelEmpleado" runat="server" Text="Label"></asp:Label>
            </td>
            <td style="font-weight: bold; height: 18px; width: 112px;">
                Cedula</td>
                <td style="height: 18px; width: 112px" >
                    <asp:Label ID="labelClienteCedula" runat="server" Text="Label"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                &nbsp;</td>
            <td style="height: 14px; width: 111px">
                &nbsp;</td>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                &nbsp;</td>
            <td style="font-weight: bold; height: 14px; width: 112px;">
                &nbsp;</td>
                <td style="height: 14px; width: 112px" >
                    &nbsp;</td>
        </tr>
        <tr>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                Monto</td>
            <td style="height: 14px; width: 111px">
                <asp:Label ID="labelMonto" runat="server"  
                    Text="Label"></asp:Label>
            </td>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                Impuesto</td>
            <td style=" height: 14px; width: 112px;">
                <asp:Label ID="labelImpuesto" runat="server" Text="Label"></asp:Label>
            </td>
                <td style="height: 14px; width: 112px" >
                    &nbsp;</td>
        </tr>
        <tr>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                Total</td>
            <td style="height: 14px; width: 111px">
                <asp:Label ID="labelTotal" runat="server" style="font-weight: bold" 
                    Text="Label"></asp:Label>
            </td>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                Tipo de Pago</td>
            <td  height: 14px; width: 112px;">
                <asp:Label ID="labelPago" runat="server" Text="Label"></asp:Label>
            </td>
                <td style="height: 14px; width: 112px" >
                    &nbsp;</td>
        </tr>
        <tr>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                &nbsp;</td>
            <td style="height: 14px; width: 111px">
                &nbsp;</td>
            <td style="font-weight: bold; height: 14px; width: 111px;">
                &nbsp;</td>
            <td style="font-weight: bold; height: 14px; width: 112px;">
                &nbsp;</td>
            <td style="height: 14px; width: 112px">
                &nbsp;</td>
        </tr>
    </table>

                                    <asp:Button ID="ButtonCerrar" runat="server"  
                                        Text="Cerrar" onclick="ButtonCerrar_Click" />
                                        
                                    <br />
                                    <asp:Label ID="label" runat="server" Text=""></asp:Label>
                                    <br />
                                    
                    
                   
                    
           
                                    <asp:Panel ID="ListDetalles" runat="server">
    </asp:Panel>
    
</div>  
                                    <br />
                                    <br />
                                    <br />
                                    
               <asp:Panel ID="PanelAdd" runat="server">
                     
                                        
 <table style="width: 100%;">
        <tr>
            
            <td>
                Categoria</td>
            <td>
                &nbsp; Producto</td>
            <td>
                &nbsp; Precio Unidad</td>
            <td>
                Cantidad</td>
            <td rowspan="4">
                <asp:Button ID="addButton" runat="server" Text="Agregar" onclick="addButton_Click" 
                     />
            </td>
        </tr>
        <tr>
            <td rowspan="3">
                <asp:ListBox ID="ListCategory" runat="server" AutoPostBack="True" 
                    SelectionMode="Multiple" 
                    onselectedindexchanged="ListCategory_SelectedIndexChanged"></asp:ListBox>
                </td>
            <td>
                <asp:DropDownList ID="DropDownListProductos" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownListProductos_SelectedIndexChanged" 
                    >
                </asp:DropDownList>
                </td>
            <td>
                
                <asp:TextBox ID="textPrecio" runat="server" Width="50px" AutoPostBack="True" 
                    ontextchanged="textPrecio_TextChanged" ></asp:TextBox>
                                            </td>
            <td>
                <asp:TextBox ID="textCantidad" runat="server" AutoPostBack="True" 
                     Width="50px" ontextchanged="textCantidad_TextChanged"></asp:TextBox>
                </td>
        </tr>
        <tr>
            <td>
                Precio Referencia</td>
            <td>
                
                Diferencia %</td>
            <td>
                Precio Total</td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="LabelPrecioR" runat="server" Text="Label"></asp:Label>
            </td>
            <td>
                
                <asp:TextBox ID="textPorcent" runat="server" AutoPostBack="True" 
                     Width="50px" ontextchanged="textPorcent_TextChanged"></asp:TextBox>
                </td>
            <td>
                <asp:Label ID="labelPrecioTotal" runat="server"></asp:Label>
                </td>
        </tr>
        </table>
</asp:Panel>                             

<asp:HiddenField ID="Id" runat="server" Visible="False" />

</ContentTemplate>
        </asp:UpdatePanel>
        
    <asp:Panel ID="PanelImprimir" runat="server">
    <a href="javascript:void(printSpecial())">Imprimir Factura</a> 
    </asp:Panel>

    </div>
</asp:Content>
